﻿using QQZiFramework;
using QQZiFramework.Membership;

namespace TestProject1
{
    [TestClass]
    public class TestWSDBContext
    {
        DBContext Context;
        public TestWSDBContext()
        {
            // var _OEMProgram = new OEMProgram("DMTEST");
            var _OEMProgram = new OEMProgram("JPAAS-WS");
            _OEMProgram.Run(null);
            Context = _OEMProgram.CreateDBContext();


        } 
 

         [TestMethod]
        public void TestCustomParamters()
        {
            var result =Context.CreateQueryBuilder().Permission("index_summary").Select("CreateAll").From(typeof(EmptyEntity)).Equal("dept_id", "547").Equal("id_IN","a, b,c|d,e,f").QueryMany();
            
            //  result =Context.CreateQueryBuilder().Permission("index_summary").Select("CreateAll").From(typeof(EmptyEntity)).Equal("dept_id", "547,'").Equal("id_IN","1,2,3").QueryMany();
            
        }

         [TestMethod]
        public void TestBulkInsert()
        { 
            List<FlowInstanceUsers> list2 = new List<FlowInstanceUsers>();
            for (var i = 0; i < 20; i++)
            {   
                
                var entity = new FlowInstanceUsers(){ processInstanceId=i.ToString(), userId=i.ToString(),userType="assi"  };
                list2.Add(entity);
            }
            Context.DoBulkInsert(list2);

        }


    }
}